home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 351-375 / disk_359 / dice / dice.lzh / doc / das.doc < prev    next >
Text File  |  1990-05-19  |  4KB  |  108 lines

  1.  
  2.             DAS ASSEMBLY DOCUMENTATION
  3.  
  4.  
  5.                   Matthew Dillon
  6.                   891 Regal Rd.
  7.                   Berkeley, Ca. 94708
  8.                   USA
  9.  
  10.                   uunet.uu.net!overload!dillon
  11.  
  12.  
  13.  
  14.     DAS asmfile [-o objectfile]
  15.  
  16.     DAS is a minimal 68000 assembler designed to assemble the output of DC1
  17.  
  18.     DAS SHOULD NOT BE USED FOR ASSEMBLY PROJECTS, IT IS MEANT SOLELY TO DEAL
  19.     WITH THE OUTPUT FROM THE COMPILER.
  20.  
  21.     NOTE:   Das does not implement all instructions and doesn't do the right
  22.         thing with MOVEM sea,regs when sea required a word or more of
  23.         extension.
  24.  
  25.         Das cannot handle expressions other than simple + and - where
  26.         only one label in the expression is allowed to be an external
  27.         reference.
  28.  
  29.         Das does not understand integral types other than decimal and hex.
  30.  
  31.         Das does not understand strings 'string'.
  32.  
  33.         Das cannot export EQU labels (i.e. ABS references).
  34.  
  35.                     FEATURES
  36.  
  37.     Das includes optimization features used by the compiler.  Also, Das can
  38.     handle arbitrary forward referenced REG labels for MOVEM which most
  39.     assemblers cannot.
  40.  
  41.     Das allows and automatically coagulates multiple occurances of section
  42.     directives of the same name and type.
  43.  
  44.     Das automatically pads CODE sections with NOPs instead of 0's.  However,
  45.     DS.L will always pad with 0.
  46.  
  47.  
  48.     DAS handles the following directives:
  49.  
  50.     DC        declare data
  51.     DS        declare space / align
  52.  
  53.     SECTION     declare a section.  Sections may be repeated to flip
  54.             back and forth between them.  A third argument
  55.             may contain a value to be ORd with the hunk
  56.             type field, usually used to specify special
  57.             hunk flags (i.e. hunk to chip memory, etc...)
  58.  
  59.     XREF        import a label
  60.     XDEF        export a label
  61.     EQU        declare a constant (must be a numerical constant)
  62.     REG        declare zero or more registers in register list
  63.  
  64.     PROCSTART    used to determine procedure boundries for A5 check/
  65.     PROCEND     link/unlk removal.  Also automatically sets optimization
  66.             option to 1 if 0.
  67.  
  68.     DAS handles the following expressions:
  69.  
  70.     +, -, negation.  Only one relocatable label allowed per expression.
  71.     Any number of EQU'd labels allowed, forward or reverse referenced.
  72.  
  73.     Optimization level 0 (default unless PROCSTART exists in file)
  74.  
  75.     * MOVEM's using 'reg' labels are optimized to either a MOVE or by
  76.       removing the MOVEM entirely (reg labels that specify no registers).
  77.  
  78.     * BRANCHES to BRAs are optimized (up to 20 hops)
  79.     * unsized BRANCHES are optimized to byte branches if possible
  80.     * BRANCHES to the next instruction are deleted
  81.  
  82.     Optimization level 1  (automatic if PROCSTART exists in file)
  83.  
  84.     * LINK/UNLK within PROCSTART/PROCEND bounds is removed if the link
  85.       register (currently hardwired to be A5) is never referenced AND if
  86.       no subroutine calls are made within the procedure (JSR's or BSR's)
  87.  
  88.       This allows support of stack backtraces while optimizing most low
  89.       level routines written in C.    Removal of LINK/UNLK in routines that
  90.       make other subroutine calls does not yield much of an efficiency
  91.       boost anyway.
  92.  
  93.                     PROBLEMS
  94.  
  95.     DAS Uses an incredible amount of memory due to efficiency considerations
  96.     in the optimization and myself wanting to keep it FAST.
  97.  
  98.     When specifying DIFFERENTLY NAMED CODE SECTIONS in the SAME ASSEMBLY FILE,
  99.     keep in mind that the code sections are not necessarily near to each other
  100.     in the final link and the linker cannot generate a jump table for
  101.     PC-Relative inter-module calls.  Thus, one section calling another should
  102.     not use PC-Relative unless you *know* your final executable is going to
  103.     be less than 32K *AND* you do not use the -frag option to dlink.
  104.  
  105.     This is why the startup c.a references the autoinit sections with
  106.     absolute calls instead of PC-relative calls.
  107.  
  108.